package com.bjqg.bjqg01.bjqg.bean;

import android.os.Parcel;
import android.os.Parcelable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Created by bjqg01 on 2018/1/18.
 */
@Entity
public class History implements Parcelable {
    @Id
    private Long id;
    @Property(nameInDb = "TYPE")
    private String type;
    @Property(nameInDb = "DATE")
    private Long date;
    @Property(nameInDb = "CONTENT")
    private String content;
    @Generated(hash = 364206802)
    public History(Long id, String type, Long date, String content) {
        this.id = id;
        this.type = type;
        this.date = date;
        this.content = content;
    }
    @Generated(hash = 869423138)
    public History() {
    }

    protected History(Parcel in) {
        type = in.readString();
        content = in.readString();
    }

    public static final Creator<History> CREATOR = new Creator<History>() {
        @Override
        public History createFromParcel(Parcel in) {
            return new History(in);
        }

        @Override
        public History[] newArray(int size) {
            return new History[size];
        }
    };

    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getType() {
        return this.type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Long getDate() {
        return this.date;
    }
    public void setDate(Long date) {
        this.date = date;
    }
    public String getContent() {
        return this.content;
    }
    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {

        dest.writeLong(id);
        dest.writeString(type);
        dest.writeLong(date);
        dest.writeString(content);
    }
}
